-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Dockerfile #3
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your image has a size of 4.97GB. Mostly because of compiler artifacts and the Rust compiler toolchain, neither of which are needed in the image.
Something like this:
FROM rust:1.79 AS builder
WORKDIR /app
COPY ./ ./
RUN cargo build --release
FROM debian:bookworm-slim
RUN apt-get update && \
apt-get upgrade && \
apt-get install -y libsqlite3-0 libpq5 && \
apt-get clean all && \
rm -rf /var/lib/apt/lists/*
COPY --from=builder /app/target/release/covclaim /usr/local/bin/covclaim
EXPOSE 1234
CMD ["/usr/local/bin/covclaim"]
Has only 93MB. The most important thing is separating the build into two stages, one to compile and one that will become the actual image.
And rebase this branch. I just pushed a fix that allows covclaim to start without an |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be good after couple more minor changes
Added a simple Dockerfile for docker deployments.
Feel free to give suggestions to make it the build quicker or the image smaller